package uni.j2ee.forum.request;

import uni.j2ee.forum.helper.CommonHelper;
import uni.j2ee.forum.model.ForumData;
import uni.j2ee.forum.model.ForumUser;
import uni.j2ee.forum.navigation.Navigation;

public class AddUserRequest {
	final private ForumUser data = new ForumUser();
	
	public ForumUser getData() {
		return data;
	}
	
	public String addUser() {
		if(ForumData.getInstance().addEntity(data)) {
			CommonHelper.addMessage("addUser_ok", false);
			return Navigation.LOGIN;
		}
		CommonHelper.addMessage("addUser_user_exist", true);
		return null;
	}
}
